#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<string>
#include<list>
using namespace std;
void Test_String1()
{
	string s1;
	string s2("hello");
	cin >> s1;
	/*cout << s1 << endl;
	cout << s2 << endl;*/
	//string ret = s1 + s2;
	string ret = s1 + "hello";
	cout << ret << endl;
}
void Test_String2()
{
	string s2("hello world");
	/*for (size_t i = 0; i < s1.size(); i++)
	{
		cout << s1[i];
	}
	cout << endl;*/

	/*string::iterator it = s1.begin();
	while (it != s1.end())
	{
		cout << *it;
		it++;
	}*/
	/*string::reverse_iterator Itit = s1.rbegin();
	while (Itit != s1.rend())
	{
		cout << *Itit;
		Itit++;
	}
	cout << endl;*/

	/*string::iterator it = s1.begin();
	while (it != s1.end())
	{
		*it='a';
		it++;
	}
	cout << s1;*/

	/*list<int> s1;
	s1.push_back(1);
	s1.push_back(2);
	s1.push_back(3);
	s1.push_back(4);

	list<int>::iterator it = s1.begin();
	while (it != s1.end())
	{
		cout << *it;
		it++;
	}
	cout << endl;*/
}
void func(const string& s)
{
	string::const_iterator it = s.begin();
	while (it != s.end())
	{
		cout << *it;
		it++;
	}
	cout << endl;

	string::const_reverse_iterator it1 = s.rbegin();
	while (it1 != s.rend())
	{
		cout << *it1;
		it1++;
	}
	cout << endl;
}
void Test_String3()
{
	string s1("hello world");
	for (auto ch : s1)
	{
		cout << ch;
	}
	cout << endl;
	func(s1);
}
int main()
{
	Test_String3();
	return 0;
}